﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using IrisGenerator.Framework.Reflection;

namespace IrisGenerator.Framework.Rules.Reflection
{
    public class MethodCallRule
    {
        public static bool CanBeCalled(MethodCall method)
        {
            if (method == null)
                return false;

            return MethodExists(method);
        }

        public static bool TypeExists(MethodCall method)
        {
            return method.ParentType != null;
        }

        public static bool MethodExists(MethodCall method)
        {
            if (TypeExists(method))
            {
                if (method.GetMethod() != null)
                    return true;
                else
                    return false;
            }
            else
                return false;
        }
    }
}
